/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package library;

import javax.swing.JOptionPane;
import kbcquiz.App;

public class Utils {
     public static void Alert(String msg) {
        Alert(msg, "Alert", JOptionPane.WARNING_MESSAGE);
    }

    public static void Alert(String msg, String title) {
        Alert(msg, title, JOptionPane.WARNING_MESSAGE);
    }

    public static void Alert(String msg, int type) {
        Alert(msg, "Alert", type);
    }

    public static void Alert(String msg, String title, int type) {
        JOptionPane.showMessageDialog(App.getCurrentDisplay(), msg, title, type);
    }

    public static int Confirm(String msg, String title, int type) {
        return JOptionPane.showConfirmDialog(App.getCurrentDisplay(), msg, title, type);
    }

    public static int Confirm(String msg, String title) {
        return Confirm(msg, title, JOptionPane.OK_CANCEL_OPTION);
    }

    public static int Confirm(String msg, int type) {
        return Confirm(msg, "Confirm", type);
    }

    public static int Confirm(String string) {
        return Confirm(string, "Confirm?");
    }

    public static java.sql.Date getCurrentJavaSqlDate() {
        java.util.Date today = new java.util.Date();
        return new java.sql.Date(today.getTime());
    }
}
